<link rel="stylesheet" type="text/css" href="/templates/styles/tabcontent.css">
<script type="text/javascript" src="/templates/scripts/tabcontent.js"></script>
<script type="text/javascript" src="/templates/scripts/checkinput.js"></script>
<!-- TinyMCE -->
<!-- /TinyMCE -->
{if isset($founduser) && $founduser==2}
    <script language="JavaScript">
        alert('Email đã đã đăng ký');
        setTimeout("top.location.href = '/admin/user'",0);
    </script>
{/if}
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td class="bgtitle">
            <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                <tr>
                    <td width="20">
                        <img src="/templates/images/mui_ten.gif" /></td>
                    <td valign="bottom" class="title">Danh sách người dùng</td>
                    <td width="10" valign="bottom">&nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>     
    <tbody>
        <tr>
            <td valign="top">
                <table width="100%" style="border-collapse: collapse" border="0" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
                </table>
                <br>
                <!-- 3 menu cố định -->
                <div id="pettabs" class="indentmenu">
                    <ul>
                        <li>
                            <a href="#" rel="dog1" class="selected">
                                <strong>Khách hàng</strong>
                            </a>
                        </li>
                        <li>
                            <a href="#" rel="dog2" class="">
                                <strong>Nhân viên</strong>
                            </a>
                        </li>
                        <li>
                            <a href="#" rel="dog3" class="">
                                <strong>Thêm thành viên</strong>
                            </a>
                        </li>

                    </ul>
                    <br style="clear: left">
                </div>

                <!-- Chọn menu nào thì tab đó xuất hiện -->
                <div style="border:1px solid #CCCCCC; width:960px; padding-bottom:0px; padding-left:0px; padding-right:0px; padding-top:0px;">
                    <!-- Dog 1, chèn nội dung vào đây --->
                    <div id="dog1" class="tabcontent" style="display: block;">
                        <!--hiện thị sản phẩm-->
                        <!--form them san pham-->
                        <form action="/login" method="post" enctype="multipart/form-data" name="loginForm" id="loginForm" style="margin:0; padding:0" onsubmit="return verifyloginForm(this)">
                            
                            <table class="display dataTable" id="example" width='100%' align='center' border='0' cellpadding='2'  cellspacing='0' bordercolor='#CCCCCC' style='border-collapse:collapse;font-size:12px; margin-bottom:10px'>
                                <thead>
                                    <tr>
                                        <th height='30' class='bgmenupro border3' bgcolor='#DDDDDD' style="width:23px!important">
                                <div align='center'>
                                    <strong>STT</strong>
                                </div>
                                </th>
                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:160px!important">
                                <div align='center'>
                                    <strong>Email</strong>
                                </div>
                                </th>
                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:150px!important">
                                <div align='center'>
                                    <strong>Họ và tên</strong>
                                </div>
                                </th>

                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:100px!important">
                                <div align='center'>
                                    <strong>Phone</strong>
                                </div>
                                </th>
                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:230px!important">
                                <div align='center'>
                                    <strong>Địa chỉ</strong>
                                </div>
                                </th>
                                <th class='bgmenupro borderfull' bgcolor='#DDDDDD' style="width:60px!important">
                                <div align='center'>
                                    <strong>Điểm</strong>
                                </div>
                                </th>
                                <th class='bgmenupro borderfull' bgcolor='#DDDDDD' width='3%'>
                                <div align='center'>
                                    <strong>Tùy chỉnh</strong>                     
                                </div>
                                </th>
                                </tr>
                                </thead>
                                <tbody>
                                    <!--load khách hàng-->
									{$i = 1}
                                    {foreach from=$user item=u}
										{if $u.idpermission==4}
											<tr>
												<td class='border3'>{$i++}</td>
												<td class='border3'>{$u.email}</td>
												<td class='border3'>{$u.fullname}</td>
												<td class='border3'>{$u.phone}</td>
												<td class='border3'>{$u.address}</td>
												<td class='border3'>{$u.point}</td>
												<td class='borderfull' >
													<div align='center'>
														<a href='/admin/user/delete/{$u.id}'>
															<img src='/templates/images/deleteuser.png' border='0'>
														</a>
													</div>
												</td>
											</tr>
										{/if}
                                    {/foreach}
                                    <!--load xong -->
                                </tbody>

                            </table>
                            <br>
                            <br>
                        </form>
                        <br />
                        <!-- begin: popup!-->
                        <script language="javascript">
							/*
                        Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
                        Permission granted to Dynamic Drive to feature script in archive
                        For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
							 */

							var win = null;
							function NewWindow(mypage,myname,w,h,scroll){
							LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
							TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
							settings =
								'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
							win = window.open(mypage,myname,settings)
						}

                        </script>
                        <!-- end: popup!-->
                        <!--/hiện thị sản phẩm-->
                    </div>

                    <!--Dog2,Thêm sản phẩm-->
                    <div id="dog2" class="tabcontent" style="display: none;">

                        <!--form hiện thị nhan vien -->
                        <form action="/admin/user" method="post" enctype="multipart/form-data" name="loginForm" id="loginForm" style="margin:0; padding:0" onsubmit="return verifyloginForm(this)">
                            <table class="display dataTable" id="example1" width='100%' align='center' border='0' cellpadding='2'  cellspacing='0' bordercolor='#CCCCCC' style='border-collapse:collapse;font-size:12px; margin-bottom: 10px'>
                                <thead>
                                    <tr>
                                        <th height='30' class='bgmenupro border3' bgcolor='#DDDDDD' style="width:23px!important">
                                <div align='center'>
                                    <strong>STT</strong>
                                </div>
                                </th>
                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:200px!important">
                                <div align='center'>
                                    <strong>Email</strong>
                                </div>
                                </th>
                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:160px!important">
                                <div align='center'>
                                    <strong>Họ và tên</strong>
                                </div>
                                </th>
                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:100px!important">
                                <div align='center'>
                                    <strong>Phone</strong>
                                </div>
                                </th>
                                <th class='bgmenupro border3' bgcolor='#DDDDDD' style="width:180px!important">
                                <div align='center'>
                                    <strong>Địa chỉ</strong>
                                </div>
                                </th>

                                </th>
                                <th class='bgmenupro borderfull' bgcolor='#DDDDDD' style="width:70px!important">
                                <div align='center'>
                                    <strong>Loại</strong>                     
                                </div>
                                </th>
                                <th class='bgmenupro borderfull' bgcolor='#DDDDDD' width='3%'>
                                <div align='center'>
                                    <strong>Tùy chỉnh</strong>                     
                                </div>
                                </th>
                                </tr>
                                </thead>
                                <tbody>
                                    <!--load nhân viên-->
									{$i = 1}
                                    {foreach from=$user item=u}
										{if $u.idpermission!=4}
											<tr>
												<td class='border3'>{$i}</td>
												<td class='border3'>{$u.email}</td>
												<td class='border3'>{$u.fullname}</td>
												<td class='border3'>{$u.phone}</td>
												<td class='border3'>{$u.address}</td>
												<td class='border3'>
													<select name="staff_permission[{$i-1}]" id="staff_permission[{$i-1}]">
														{foreach from=$permission item=permission_item}
															{if $permission_item.idpermission != 4}
															<option value="{$permission_item.idpermission}" {if $permission_item.idpermission == $u.idpermission}selected="selected"{/if}>{$permission_item.permission}</option>
															{/if}
														{/foreach}
													</select>
													<input type="hidden" value="{$u.id}" id=staff_id[{$i-1}] name="staff_id[{$i++ -1}]">
												</td>
												<td class='borderfull' >
													<div align='center'>
														<a href='/admin/user/delete/{$u.id}'>
															<img src='/templates/images/deleteuser.png' border='0'>
														</a>
													</div>
												</td>
											</tr>
										{/if}
                                    {/foreach}
                                    <!--load xong -->
                                </tbody>
                            </table>
                            <br>
                            <br>
							<div align="center">
								<input type="submit" id="staff_save" name="staff_save" value="Lưu CSDL">
								<input type="reset" id="staff_reset" name="staff_reset" value="Làm lại">
							</div>
                        </form>
                        <br />
                    </div>
                    <!--Dog2,Thêm sản phẩm xong-->
                    <!-- Dog 3, Thêm user --->
                    <div id="dog3" class="tabcontent" style="display: none;">
                        <!--noi dung cua category-->
						<form action="/admin/user/create" method="post" enctype="multipart/form-data" name="registerForm" id="registerForm" style="margin:0; padding:0" onsubmit="return verifyregisterForm(this)">				
							<table width="35%" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC" style="font-family: Tahoma; font-size: 10pt; border-collapse:collapse; padding:10px">
								<tbody>
									<tr>
                                        <td class="bgtitle" colspan="6">
                                            <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                                                <tr>
                                                    <td width="20">
                                                        <img src="/templates/images/mui_ten.gif" /></td>
                                                    <td valign="bottom" class="title">Thêm người dùng</td>
                                                    <td width="10" valign="bottom">&nbsp;</td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>
										</td>
                                    </tr>  
									<tr>
										<td width="40%">Địa chỉ email (*) </td>
										<td width="60%">
											<input name="email" type="text" class="box_input" id="email" size="24">
										</td>
									</tr>

									<tr>
										<td valign="top">Họ và Tên (*)</td>
										<td>
											<input name="fullname" type="text" class="box_input" id="fullname" size="24">
										</td>
									</tr>
									<tr>
										<td>Mật khẩu</td>
										<td>
											mpcamera
											<input name="pass" type="hidden" class="box_input" id="pass" value="mpcamera">
											<input name="pass2" type="hidden" class="box_input" id="pass2" value="mpcamera">
										</td>
									</tr>
									<tr>
										<td valign="top">CMND (*)</td>
										<td>
											<input name="cmnd" type="text" class="box_input" id="CMND" size="24">
										</td>
									</tr>
									<tr>
										<td valign="top">Địa chỉ (*)</td>
										<td>
											<input name="address" type="text" class="box_input" id="address" size="24">
										</td>
									</tr>
									<tr>
										<td valign="top">Điện thoại (*)</td>
										<td>
											<input name="phone" type="text" class="box_input" id="phone" size="24">
										</td>
									</tr>

									<tr>
										<td valign="top">Quyền User
										</td>	
										<td>

											<select id="permission" name="permission">
												{foreach from=$permission item=item_permission}
													{if $item_permission.idpermission!=1}
														<option value="{$item_permission.idpermission}">{$item_permission.permission}</option>
													{/if}
												{/foreach}
											</select>

										</td>
									</tr>									
									<tr bgcolor="">
										<td valign="top">&nbsp;</td>
										<td><table border="0" cellspacing="0" cellpadding="0">
												<tbody>
													<tr>
														<td>
															<input type="submit" name="usercreate" id="usercreate" value="Tạo user">
														</td>
														<td width="10">&nbsp;</td>
														<td>&nbsp;</td>
													</tr>
												</tbody>
											</table>
										</td>
									</tr>

								</tbody>
							</table>
						</form>
						<!--load xong catrgory-->
					</div>
				</div>
			</td>
		</tr>
	</tbody>
</table>

<script type="text/javascript">
var mypets=new ddtabcontent("pettabs")
mypets.setpersist(true)
mypets.setselectedClassTarget("link")
mypets.init(0)
</script>
<br>
<!---ham tao tab-->
